关于 JSON,以下代码输出什么
const obj = {
a: 3,
b: 4,
c: null,
d: undefined,
get e() {},
};
console.log(JSON.stringify(obj));
{"a":3,"b":4,"c":null}
对其中的 undefined,function 将在 JSON.stringify 时会忽略掉
const obj = {
a: 3,
b: 4,
c: null,
d: undefined,
get e() {},
};
console.log(JSON.stringify(obj));
{"a":3,"b":4,"c":null}
对其中的 undefined,function 将在 JSON.stringify 时会忽略掉